<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>PeekConsoleInput</title>
<meta http-equiv="Content-Type" Content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="../../styles/styles.css">
<script language="javascript" src='../links.js' type="text/javascript"></script>
</head>
<body>

<h1>PeekConsoleInput</h1>
<div class=navbar>
<a href="../index.html">main</a> |
<a href="../structures/index.html">structures</a> |
<a href="index.html">win32 structures</a>
</div>


<div class=shortdescr>
The <strong>PeekConsoleInput</strong> function reads data from the specified console input buffer
without removing it from the buffer.
</div>

<pre class=syntax>
BOOL PeekConsoleInput(
  HANDLE hConsoleInput,
  PINPUT_RECORD lpBuffer,
  DWORD nLength,
  LPDWORD lpNumberOfEventsRead
);
</pre>

<h3>Parameters</h3>
<div class=descr>

    <div class=dfn>hConsoleInput</div>
    <div class=dfndescr>Handle to the input buffer. The handle must have GENERIC_READ access.</div>
    <div class=dfn>lpBuffer</div>
    <div class=dfndescr>Pointer to an <a href="input_record.html">INPUT_RECORD</a> buffer that receives the input buffer data.</div>
    <div class=dfn>nLength</div>
    <div class=dfndescr>Specifies the size, in records, of the buffer pointed to by the <strong>lpBuffer</strong> parameter.</div>
    <div class=dfn>lpNumberOfEventsRead</div>
    <div class=dfndescr>Pointer to a variable that receives the number of input records read.</div>

</div>

<h3>Return value</h3>
<div class=descr>
  <p>If the function succeeds, the return value is nonzero.<br>
  If the function fails, the return value is zero.
  To get extended error information, call <a href="win32/GetLastError">GetLastError</a>.</p>
</div>

<h3>Remarks</h3>
<div class=descr>
  <p>If the number of records requested exceeds the number of records available in the buffer,
  the number available is read. If no data is available, the function returns immediately.</p>

  <p class=note><img src="../../images/note.gif" alt="Windows NT family" width="10" height="10"> Windows NT/2000/XP/2003/Vista/2008/7</p>
  <UL class=note><LI>
  This function uses either Unicode characters or 8-bit characters from the console's current
  code page. The console's code page defaults initially to the system's OEM code page.
  To change the console's code page, use the <a href="win32/SetConsoleCP">SetConsoleCP</a>
  or <a href="win32/SetConsoleOutputCP">SetConsoleOutputCP</a> functions, or use the
  <code>chcp</code> or <code>mode&nbsp;con&nbsp;cp&nbsp;select=</code> commands.  
  </LI></UL>
</div>


<div class=see>See also:</div><div class=seecont>
<a href="input_record.html">INPUT_RECORD</a>,
<a href="readconsoleinput.html">ReadConsoleInput</a>,
<a href="win32/SetConsoleCP">SetConsoleCP</a>,
<a href="win32/SetConsoleOutputCP">SetConsoleOutputCP</a>,
<a href="writeconsoleinput.html">WriteConsoleInput</a>
</div>

</body>
</html>